package com.wpf.test02;

public class demo {
    public static void main(String[] args) {
        try {
            Student student1 = new Student("张飞", "玩", 55);
            System.out.println(student1);
        } catch (SexException e) {
            System.out.println("性别错误");
        } catch (AgeException e) {
            System.out.println("年龄错误");
        }

        try {
            Student student2 = new Student("张飞", "男", 55);
            System.out.println(student2);
        } catch (SexException e) {
            System.out.println("性别错误");
        } catch (AgeException e) {
            System.out.println("年龄错误");
        }


        try {
            Student student3 = new Student("张飞", "男", 35);
            System.out.println(student3);
        } catch (SexException e) {
            System.out.println("性别错误");
        } catch (AgeException e) {
            System.out.println("年龄错误");
        }


    }
}
